#include "widget.h"
#include "ui_widget.h"
#include <QMouseEvent>
#include <QDebug>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::wheelEvent(QWheelEvent *event)
{
    static int x = 0;
    x += event->delta();
    if(event->delta() > 0)
    {
        qDebug() << "滚轮前滑"<<x;
    }
    if(event->delta() < 0)
    {
        qDebug() << "滚轮后滑"<<x;
    }
}

